package com.yuyou.tas.lesson.mapper;

import com.yuyou.tas.service.api.lesson.dto.LessonPageDTO;
import com.yuyou.tas.service.api.lesson.dto.LessonStatisticDTO;
import com.yuyou.tas.service.api.lesson.entity.Lesson;
import com.yuyou.tas.util.bean.Pagination;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface LessonMapper {
    int deleteByPrimaryKey(Long id);
    
    int delLessonByOId(@Param(value="oId")  Long oId,@Param(value="authOrganizationId") Long authOrganizationId);

    int insert(Lesson record);

    Lesson selectByPrimaryKey(Long id);
    
    Lesson selectByPKandOrgan(@Param(value="id") Long id,@Param(value="authOrganizationId") Long authOrganizationId);

    Lesson selectByOrgan7OId(@Param(value="oId") Long oId,@Param(value="authOrganizationId") Long authOrganizationId);
    
    int updateByPrimaryKeySelective(Lesson record);
    
    int findLessonCount(Pagination<LessonPageDTO> queryPgn);
    
    List<LessonPageDTO> findLessonPageList(Pagination<LessonPageDTO> queryPgn);
    
    List<Lesson> findPubLessonByOrganId(Long authOrganizationId);

    int findLessonStatisticCount(Pagination<LessonStatisticDTO> queryPgn);

    List<LessonStatisticDTO> findLessonStatisticPageList(Pagination<LessonStatisticDTO> queryPgn);
    
    List<Lesson> selectByTrimester(@Param(value="trimesterId") Long trimesterId);

    List<Lesson> selectByLevel(@Param(value="levelId") Long levelId , @Param(value = "organId") Long organId) ;

    Lesson selectByClassId(@Param(value = "classId") Long classId);
}